import { useDict } from '/@/hooks/dict';
const { yes_no_type } = useDict('yes_no_type'); //是否字典
const { expert_score } = useDict('expert_score'); //专家评价
const { professional_fields } = useDict('professional_fields'); //专业领域
const { industry_fields } = useDict('industry_fields'); //行业领域
const { extract_status } = useDict('extract_status'); //抽取结果
const { is_attend } = useDict('is_attend'); //是否参会

export default {
	yesNoType: (data: any) => {
		let zhi = '';
		yes_no_type.value.forEach((item: any) => {
			if (item.value == data) {
				zhi = item.label;
			}
		});
		return zhi;
	},
	expertScore: (data: any) => {
		if (!data) {
			return;
		}
		let zhi = '';
		expert_score.value.forEach((item: any) => {
			if (item.value == data) {
				zhi = item.label;
			}
		});
		return zhi;
	},
	//所属行业领域
	expertIndustryFields: (data: any) => {
		if (!data) {
			return;
		}
		// let arr = data.split(',');
		let arr = data;
		let zhi: any = [];
		arr.forEach((item: any) => {
			industry_fields?.value.forEach((it: any) => {
				if (it.value == item) {
					zhi.push(it.label);
				}
			});
		});
		return zhi.join(',');
	},
	//所属专家领域
	expertProfessionalFields: (data: any) => {
		if (!data) {
			return;
		}
		let arr = data;
		let zhi: any = [];
		arr.forEach((item: any) => {
			professional_fields?.value.forEach((it: any) => {
				if (it.value == item) {
					zhi.push(it.label);
				}
			});
		});
		return zhi.join(',');
	},
	//抽取结果
	extractStatus: (data: any) => {
		let zhi = '';
		extract_status.value.forEach((item: any) => {
			if (item.value == data) {
				zhi = item.label;
			}
		});
		return zhi;
	},
	//是否参会
	evaluateAttend: (data: any) => {
		let zhi = '';
		is_attend.value.forEach((item: any) => {
			if (item.value == data) {
				zhi = item.label;
			}
		});
		return zhi;
	},
};
